//
//  ALPEditorHeadView.m
//  AlpFM
//
//  Created by dllo on 16/1/28.
//  Copyright © 2016年 Alp. All rights reserved.
//

#import "ALPEditorHeadView.h"

@interface ALPEditorHeadView ()
@property (nonatomic, strong) UILabel *labelTitle;
@property (nonatomic, strong) UILabel *labelfuTitle;
@property (nonatomic, strong) UILabel *labelDescribe;
@property (nonatomic, strong) UIImageView *bigImage;
@property (nonatomic, strong) UIImageView *smallImage;
@property (nonatomic, strong) UIImageView *youjiantou;

@end

@implementation ALPEditorHeadView

-(instancetype)initWithFrame:(CGRect)frame{
    self = [super initWithFrame:frame];
    if (self) {
        [self creat];
    }
    return self;
}
-(void)creat{
    
    //按钮
    UIButton *button = [UIButton buttonWithType:UIButtonTypeCustom];
    button.frame = CGRectMake(15, 20, 30, 25);
    [button setBackgroundImage:[UIImage imageNamed:@"fanhuijiantou"] forState:UIControlStateNormal];
    [button addTarget:self action:@selector(fanhui:) forControlEvents:UIControlEventTouchUpInside];
    [self addSubview:button];
    
    self.labelTitle = [[UILabel alloc]initWithFrame:CGRectMake(50, 20, 250, 25)];
    self.labelTitle.backgroundColor = [UIColor clearColor];
    self.labelTitle.textColor = [UIColor whiteColor];
    self.labelTitle.textAlignment = NSTextAlignmentCenter;
    [self addSubview:self.labelTitle];
    
    self.labelfuTitle = [[UILabel alloc]initWithFrame:CGRectMake(115, 84, 200, 20)];
    self.labelfuTitle.textColor = [UIColor whiteColor];
    [self addSubview:self.labelfuTitle];
    
    self.bigImage = [[UIImageView alloc]initWithFrame:CGRectMake(10, 80, 60, 60)];
    [self addSubview:self.bigImage];
    
    self.smallImage = [[UIImageView alloc]initWithFrame:CGRectMake(80, 80, 30, 30)];
    self.smallImage.layer.masksToBounds = YES;
    self.smallImage.layer.cornerRadius = self.smallImage.bounds.size.width *0.5;
    self.smallImage.layer.borderWidth = 1.0;
    self.smallImage.layer.borderColor = [UIColor whiteColor].CGColor;
    [self addSubview:self.smallImage];
    
    self.labelDescribe = [[UILabel alloc]initWithFrame:CGRectMake(80, 120, 265, 15)];
    self.labelDescribe.textColor = [UIColor groupTableViewBackgroundColor];
    self.labelDescribe.font = [UIFont boldSystemFontOfSize:15];
    [self addSubview:self.labelDescribe];
    
    self.youjiantou = [[UIImageView alloc]initWithFrame:CGRectMake(355, 120, 20, 20)];
    self.youjiantou.image = [UIImage imageNamed:@"jiantou1"];
    [self addSubview:self.youjiantou];
}



-(void)fanhui:(UIButton *)btn{
    [self.xieyiren pop];
}

-(void)setModel:(ALPEditorPlayAlbumModel *)model{
    self.labelTitle.text = model.title;
    [self.bigImage sd_setImageWithURL:[NSURL URLWithString:model.coverWebLarge] placeholderImage:nil];
    [self.smallImage sd_setImageWithURL:[NSURL URLWithString:model.coverSmall] placeholderImage:nil];
    self.labelfuTitle.text = model.nickname;
    self.labelDescribe.text = model.introRich;
    
}



@end
